package com.systop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.systop.entity.Classify;
import com.systop.dao.ClassifyDao;
import com.systop.service.ClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassifyServiceImpl extends ServiceImpl<ClassifyDao,Classify> implements ClassifyService {
    @Autowired
    private ClassifyDao classifyDao;

    @Override
    public List<Classify> classifyFindAll(Classify classify) {
        return classifyDao.classifyFindAll(classify);
    }
    @Override
    public int classifyCountAll(Classify classify) {
        return classifyDao.classifyCountAll(classify);
    }

    //添加数据查重
    public int findClassifyByclassifyName(Classify classify){
        return classifyDao.findClassifyByclassifyName(classify);
    };
    //添加数据方法
    public int addClassify(Classify classify){
        return classifyDao.addClassify(classify);
    };

    //前端查询所有分类
    public List<Classify> findAllClassify(){
        return classifyDao.findAllClassify();
    };
    //判断前端显示数量
    public int findShowCount(Classify classify){
        return classifyDao.findShowCount(classify);
    };

    //修改数据查重
    public int findDataUnlessId(Classify classify){
        return classifyDao.findDataUnlessId(classify);
    };
    //更新数据方法
    public int udpClassify(Classify classify){
        return classifyDao.udpClassify(classify);
    };

    //删除前先查询商品中是否包含该分类的商品
    public int findGoodsByClassifyId(Classify classify){
        return classifyDao.findGoodsByClassifyId(classify);
    };
    //删除数据方法
    public int delClassify(Classify classify){
        return classifyDao.delClassify(classify);
    };
}
